

//js pour scrolltotop

function Scroll(){

	// hide #back-top first
	$("#back-top").hide();
	
	// fade in #back-top
	$(function () {
		$(window).scroll(function () {
			if ($(this).scrollTop() > 100) {
				$('#back-top').fadeIn();
				
			} else {
				$('#back-top').fadeOut();
				
			}
		});

		// scroll body to 0px on click
		$('#back-top a').click(function () {
			$('body,html').animate({
				scrollTop: 0
			}, 1200);
			return false;
		});
	});

}



//js pour afficher l'heure
var Heure=setInterval(function(){myTimer()},1000)

function myTimer() {
    var dateTime = new Date();
    document.getElementById("timeIndicator").innerHTML = dateTime.toLocaleTimeString();
}


// js pour menu Cpartie en accordeon
function accordion(params, action)
{
	if(document.getElementById("accordion-content"+action).className == "accordion")
	{
		$('#accordion-content'+action).toggle("fast");
		$("#btn"+action).attr("src", params+"/ressource/closeJoin.png");
		$('#accordion-content'+action).removeClass("accordion");
	
		if (action=="Join")
		{
		$('#btnRefreshParties').removeClass("btnNone");
		$('#btnRefreshParties').addClass("btnRefreshParties");
		}
	}
	else
	{
		
		
		
		$('#accordion-content'+action).addClass("accordion");
		$("#btn"+action).attr("src", params+"/ressource/openJoin.png");
		$('#accordion-content'+action).toggle("fast");
		if (action=="Join")
		{
			$('#btnRefreshParties').removeClass("btnRefreshParties");
		$('#btnRefreshParties').addClass("btnNone");
		}
		
	}
}

// js pour le menu principal
function openMenu(params)
{
	if(document.getElementById("menu").className == "openMenu")
	{
		$(".btnMenu").css("display", "block");
		$(".btnMenu").css("left", "5px");
		$("#menu").removeClass("openMenu");
		$("#menu").addClass("closeMenu");
		$(".btnPlayHeader").css("left", "45px");
		$(".pseudo").css("left", "100px");
	}
	else
	{
		$(".btnMenu").css("display", "none");
		$(".btnMenu").css("left", "230px");
		$(".btnPlayHeader").css("left", "280px");
		$("#menu").removeClass("closeMenu");
		$("#menu").addClass("openMenu");
		$(".pseudo").css("left", "335px");
	}
	
	$(".bloc_page").click(function()
	{
		$(".btnMenu").css("display", "block");
		$(".btnMenu").css("left", "5px");
		$(".btnPlayHeader").css("left", "45px");
		$("#menu").removeClass("openMenu");
		$("#menu").addClass("closeMenu");
		$(".pseudo").css("left", "100px");
	});
	
	$("#menu").click(function()
	{
		$(".btnMenu").css("display", "block");
		$(".btnMenu").css("left", "5px");
		$(".btnPlayHeader").css("left", "45px");
		$("#menu").removeClass("openMenu");
		$("#menu").addClass("closeMenu");
		$(".pseudo").css("left", "100px");
	});
}


// js pour les notifications
//affichage de la notif
/*function AfficherNotif(action){
	document.getElementById('notification'+action).style.right='10px';	
}
// fermeture de la notif
function closeNotif(action){
	document.getElementById('notification'+action).style.right='-550px';
}*/

function AfficherNotif(){
	
	document.getElementById('notificationNotif').style.right='10px';
	var close = setInterval(function(){closeNotif()},3000)
	
	function closeNotif(){
	document.getElementById('notificationNotif').style.right='-550px';
	clearInterval(close)
}
	
}
// fermeture de la notif




